﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace OP10.Views
{
    /// <summary>
    /// AlarmHistoryView.xaml 的交互逻辑
    /// </summary>
    public partial class AlarmsHistoryView : UserControl
    {
        public AlarmsHistoryView()
        {
            InitializeComponent();
            InitTextValue();
        }

        private void InitTextValue()
        {
            FileTimeInfo file = FileRead.GetLatestFileTimeInfo(@"C://QH//报警日志//OP10", ".txt");
            if (file != null)
            {
                TextEditor.Text = File.ReadAllText(file.FileName, Encoding.UTF8);
            }
            else { TextEditor.Text = "没有找到最近的历史报警记录!"; }
        }
    }
}
